<template>
  <button @click="back">返回</button>
  <div>
    {{ $route.params.id }}
  </div>
</template>
<script>
export default {
  methods: {
    back() {
      let flag = confirm('要返回吗？')
      if (flag) {
        this.$router.go(-1)
      }
    }
  }
}
</script>
<style scoped></style>
